package pl.ivmx.cinema.entities;

import java.io.Serializable;
import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import pl.ivmx.cinema.BaseDao;
import pl.ivmx.cinema.BasicEntity;

@Entity
@NamedQueries({
		
		@NamedQuery (
        name="movie.findMoviesWithId",
        query="SELECT m FROM Movie m WHERE m.id = :id"
), 
	@NamedQuery(
			name="movies.AllMovies",
	        query="SELECT m FROM Movie m "
	)
})
public class Movie extends BasicEntity implements Serializable {
	@Id
	private long id;

	private String title;

	@Column(name="RELEASE_DATE")
	private Date releaseDate;

	private String director;

	private static final long serialVersionUID = 1L;

	public Movie() {
		super();
	}

	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Date getReleaseDate() {
		return this.releaseDate;
	}

	public void setReleaseDate(Date releaseDate) {
		this.releaseDate = releaseDate;
	}

	public String getDirector() {
		return this.director;
	}

	public void setDirector(String director) {
		this.director = director;
	}

}
